package com.mycode.facade11.resolve;

public class NewEncryptFacade extends AbstractEncryptFacade{
    private FileReader reader;
    private FileWriter writer;
    private NewCipherMachine cipherMachine;

    public NewEncryptFacade() {
        this.reader = new FileReader();
        this.writer = new FileWriter();
        this.cipherMachine = new NewCipherMachine();
    }

    @Override
    public void fileEncrypt(String fileNameSrc, String fileNameDes) {
        String plainStr = reader.read(fileNameSrc);
        String encrypt = cipherMachine.encrypt(plainStr);
        writer.write(encrypt, fileNameDes);
    }
}
